package com.gelingqin.es.springbootdemo.controller;

import java.util.List;
import java.util.Map;

import com.gelingqin.es.springbootdemo.entity.LogRequest;
import com.gelingqin.es.springbootdemo.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * 日志服务
 * @author 86133
 *
 */
@RestController
public class LogController {
	
	@Autowired
	private LogService logService;
	
	
	/**
	 * 日志检索服务
	 * @param logRequest
	 */
	@RequestMapping("/search")
	public List<Map<String,Object>> search(@RequestBody LogRequest logRequest) {
		return logService.search(logRequest);
	}
	//时间分布聚合
	@RequestMapping("/dateHistgram")
    public void dateHistgram(@RequestBody LogRequest logRequest){
		logService.dateHistgram(logRequest);

    }

}
